package cn.classyex.business.hr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.classyex.business.hr.mapper.WelfareFundMapper;
import cn.classyex.business.hr.domain.WelfareFund;
import cn.classyex.business.hr.service.IWelfareFundService;
import com.ruoyi.common.core.text.Convert;

/**
 * 福利基金管理Service业务层处理
 * 
 * @author yex
 * @date 2021-05-06
 */
@Service
public class WelfareFundServiceImpl implements IWelfareFundService 
{
    @Autowired
    private WelfareFundMapper welfareFundMapper;

    /**
     * 查询福利基金管理
     * 
     * @param welfareFundId 福利基金管理ID
     * @return 福利基金管理
     */
    @Override
    public WelfareFund selectWelfareFundById(Long welfareFundId)
    {
        return welfareFundMapper.selectWelfareFundById(welfareFundId);
    }

    /**
     * 查询福利基金管理列表
     * 
     * @param welfareFund 福利基金管理
     * @return 福利基金管理
     */
    @Override
    public List<WelfareFund> selectWelfareFundList(WelfareFund welfareFund)
    {
        return welfareFundMapper.selectWelfareFundList(welfareFund);
    }

    /**
     * 新增福利基金管理
     * 
     * @param welfareFund 福利基金管理
     * @return 结果
     */
    @Override
    public int insertWelfareFund(WelfareFund welfareFund)
    {
        welfareFund.setCreateTime(DateUtils.getNowDate());
        return welfareFundMapper.insertWelfareFund(welfareFund);
    }

    /**
     * 修改福利基金管理
     * 
     * @param welfareFund 福利基金管理
     * @return 结果
     */
    @Override
    public int updateWelfareFund(WelfareFund welfareFund)
    {
        welfareFund.setUpdateTime(DateUtils.getNowDate());
        return welfareFundMapper.updateWelfareFund(welfareFund);
    }

    /**
     * 删除福利基金管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWelfareFundByIds(String ids)
    {
        return welfareFundMapper.deleteWelfareFundByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除福利基金管理信息
     * 
     * @param welfareFundId 福利基金管理ID
     * @return 结果
     */
    @Override
    public int deleteWelfareFundById(Long welfareFundId)
    {
        return welfareFundMapper.deleteWelfareFundById(welfareFundId);
    }
}
